//
//  ByTootBallPopTitleView.m
//  caipiao_ios
//
//  Created by mc on 2018/7/21.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByTootBallPopTitleView.h"

@implementation ByTootBallPopTitleView

- (id)init{
    self = [super init];
    if (self) {
       
        UILabel *line = [[UILabel alloc] init];
        [self addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(0);
            make.right.equalTo(self).offset(0);
            make.bottom.equalTo(self).offset(0);
            make.height.mas_equalTo(@1);
        }];
        line.backgroundColor = BY_LINE_COLOR;
        self.line = line;
        
        UILabel *vsLabel = [[UILabel alloc] init];
        [self addSubview:vsLabel];
        [vsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self).offset(0);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(50, 20));
        }];
        vsLabel.text = @"vs";
        vsLabel.textColor = [UIColor blackColor];
        vsLabel.textAlignment = NSTextAlignmentCenter;
        vsLabel.font = FONT(14);
        
        
        UILabel *teamLabel1 = [[UILabel alloc] init];
        [self addSubview:teamLabel1];
        [teamLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(0);
            make.centerY.equalTo(self).offset(0);
            make.right.equalTo(vsLabel.mas_left).offset(-10);
        }];
        teamLabel1.text = @"哈马比";
        teamLabel1.textColor = [UIColor blackColor];
        teamLabel1.textAlignment = NSTextAlignmentRight;
        teamLabel1.font = FONT(14);
        
        
        UILabel *teamLabel2 = [[UILabel alloc] init];
        [self addSubview:teamLabel2];
        [teamLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(0);
            make.centerY.equalTo(self).offset(0);
            make.left.equalTo(vsLabel.mas_right).offset(10);
        }];
        teamLabel2.text = @"鄂尔多斯";
        teamLabel2.textColor = [UIColor blackColor];
        teamLabel2.textAlignment = NSTextAlignmentLeft;
        teamLabel2.font = FONT(14);
        
        self.teamLabel1 = teamLabel1;
        self.teamLabel2 = teamLabel2;
    }
    return self;
}

- (void)setNetModel:(ByNetModel *)netModel{
    _netModel = netModel;
    
    if (_isBasketBall) {
        self.teamLabel1.text = _netModel.a_cn_abbr;
        self.teamLabel2.text = _netModel.h_cn_abbr;
    } else {
        self.teamLabel1.text = _netModel.h_cn_abbr;
        self.teamLabel2.text = _netModel.a_cn_abbr;
    }
}

- (void)setIsBasketBall:(BOOL)isBasketBall{
    _isBasketBall = isBasketBall;
    
}

@end
